********************************************************************************
*                         Analysis of Afghan Experiment                        *
********************************************************************************

* Code by Paul Musgrave (musgrave@umass.edu)
* For Paul Musgrave and Lindsey Guenther
* 2022-April-17 Revisions

* README: This code takes the cleaned data from the NATO Cyber Experiments
* conducted in April 2021 and turns them into a series of tables and charts
* for use in an appendix and manuscript.


********************************************************************************
*                                   Stata Stuff                                *
********************************************************************************

clear all

set more off

set scheme plotplainblind


global MyDocs "/Users/paulmusgrave/Dropbox/0001 Academic Projects/Ongoing/"
global MyProject "${MyDocs}0151 Lindsey NATO Cyber/Posted/Dataverse"

use "${MyProject}/NATOCyberCleaned.dta"

drop  art5* startdate enddate progress durationinseconds recordeddate ///
 yearborn gender raceaian raceasian raceblack racepacificislander ///
racewhite hispanic education partyidmain partyidstrengthd partyidstrengthr ///
partyidlean veteran veteranbranch internetfamiliarityusingalaptopc ///
internetfamiliaritycreatingandma internetfamiliaritywritingcodein ///
internetfamiliarityusingsocialne internetfamiliarityusingofficeso ///
internetfamiliaritymanagingfiles internettrickspasswords ///
internettrickstwofactor internettrickslastpass internettricksnone ///
intlattitudestheusshouldminditso intlattitudestheusshouldsupporti ///
intlattitudestheushasaspecialrol intlprioritiesmaintainingsuperio ///
intlprioritiesstrengtheningtheun intlprioritiescombatingworldhung ///
intlprioritiesimprovingtheglobal intlprioritiesdefendingusallies ///
knowledgescanning knowledgestable knowledgeuae knowledgelula ///
natobackgroundcheck knowledgecoup knowledgenukes knowledgespace ///
knowledgebrazil ifweb ifcode ifsocial ifoffice iffiles ///
attentivenessbrowser attentivenessmcu attentivenessnato attitudesownway ///
attitudesisrael attitudesexceptional prioritymilitary

order afghansupportDV afghantalibantreatment afghanrussiadeter, after(responseid)

rename afghanspecific* afghan*

lab var blockorder "Order of Experiments"

********************************************************************************
*                       Organizing Code / Macros                               *
********************************************************************************

local demographics			     age white female hispanicnum college veteran i.pid7
local technical				       attentiveness blockorder
local internetfamiliarity 	 ifdim1 i.internethours2
local cyberthreat		         internettricks internetvictim ipnumeric cyberworry2

********************************************************************************
*                      			 Core Analysis        	                       *
********************************************************************************

* Here we analyze H1 and H2 simultaneously:

	* H1: Respondents will be more likely to support committing U.S. assistance
	* the more directly involved Russia is.

	* H2: Respondents will be more likely to support committing U.S.
	* assistance the lower the cost of providing assistance.

*	Key treatment variable 1: Russian involvement
*	Key treatment variable 2: Russian response

*	Key DV: Overall approval
* 	Check DV: "Do nothing" strategy

*	Statistical method:		For Overall, Ologit unless Brant says mlogit
* 							Do nothing: OLS

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*					Analysis of Afghan Support DV							  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* Base model
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter
eststo 	h1m1

* Base with controls
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical'
eststo 	h1m2

* Base, controls, and Internet familiarity
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' `internetfamiliarity'
eststo 	h1m3

* Base, controls, and militant
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' ///
				 militantinternationalism cooperativeinternationalism
eststo 	h1m4


* Base, controls, and cyberthreat
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' ///
				 `cyberthreat'
eststo 	h1m5


* Base, controls, and knowledge
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' ///
				 knowledgeindex
eststo 	h1m6

esttab 	h1m1 h1m2 h1m3 h1m4 h1m5 h1m6, ///
				lab noomitted nobase varwidth(25) nodepvars compress ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge")
				
				

* Base, controls, but attentiveonly
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' ///
				 knowledgeindex if attentiveness == 3
eststo 	h1m7

esttab 	h1m1 h1m2 h1m3 h1m4 h1m5 h1m6, ///
				lab noomitted nobase varwidth(25) nodepvars compress ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge")

************************ Presenting Results ************************************

* * * * * * * * * * * *  Tables  * * * * * * * * * * * * * * * * * * * * * * * *



esttab 	h1m1 h1m2 h1m3 h1m4 h1m5 h1m6 using "${MyProject}/AfghanTableH1.tex", ///
				lab noomitted nobase varwidth(25) nodepvars compress replace ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
        title("Afghan Experiment, DV is Support for Ally, Ologit" \label{tab:afghanh1}) ///
        eqlabel(none) longtable notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                , nolabel)


esttab 	h1m1 h1m2 h1m3 h1m4 h1m5 h1m6 using "${MyProject}/AfghanTableH1.rtf", ///
      	lab noomitted nobase varwidth(25) nodepvars compress replace ///
        mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
        title("Afghan Experiment Testing Hypotheses 1 and 2, Main DV") ///
        eqlabel(none) notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                , nolabel)

* * * * * * * * * * * *  Graphs  * * * * * * * * * * * * * * * * * * * * * * * *

* Coefficient plot

coefplot  (h1m1, label(Base, No Controls) offset(.3)) ///
          (h1m2, label(Base With Controls) offset(.2)) ///
          (h1m3, label(Internet Knowledge) offset(.1)) ///
          (h1m4, label(Internationalism)) ///
          (h1m5, label(Internet Threat) offset(-0.1)) ///
          (h1m6, label(Political Knowledge) offset(-0.2)) ///
		  (h1m7, label(Attentive Only) offset(-0.3)) , drop(_cons) ///
          keep(*.afghantalibantreatment *.afghanrussiadeter) ///
          noomitted nobase xline(0) ///
          title({bf: A: Afghan Attack Results}, size(large) span) ///
          subtitle({it:Ordinal Logistic Coefficients Shown}, ///
            size(small) span) ///
          caption("N of 1187 for all models except for Knowledge, which has 1186." ///
            , size(vsmall)) ///
          headings(1.afghantalibantreatment = "{bf:Russia Attribution}" ///
            1.afghanrussiadeter = "{bf:Russian Reaction}") ///
            name(coefficients,replace) legend(rows(7) ring(0) pos(2))

graph export "${MyProject}/AfghanResultsH1.png", replace

* Margins plot

* Three value variant
gen       afghansupportDV3 = .
replace   afghansupportDV3 = 0 if afghansupportDV == 0 | afghansupportDV == 1
replace   afghansupportDV3 = 1 if afghansupportDV == 2
replace   afghansupportDV3 = 2 if afghansupportDV == 3 | afghansupportDV == 4
lab def   afghansupportDV3lab 0 "Oppose" 1 "Neither" 2 "Approve"
lab val   afghansupportDV3 afghansupportDV3lab
lab var   afghansupportDV3 "Support US reaction"

mylabels 0(10)90, myscale(@/100) local(myla)
quietly   ologit afghansupportDV3 i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' 
margins   afghanrussiadeter, atmeans
marginsplot, title({bf:Predicted Outcomes for Afghan Attack}, size(large) nospan) ///
             subtitle({it:By Anticipated Russian Reaction; Other Variables at Means}, size(small) span) ///
             plotdim(,elabels(1 "Oppose" 2 "Neither" 3 "Approve")) ylab(`myla')

* Five value variant
mylabels 0(10)50, myscale(@/100) local(myla)
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical'
margins     afghanrussiadeter, atmeans
marginsplot, title({bf: B: Predicted Outcomes for Afghan Attack}, size(large) nospan) ///
             subtitle({it:By Anticipated Russian Reaction; Other Variables at Means}, span size(small)) ///
             plotdim(,elabels(1 "Strongly Oppose" 2 "Oppose" 3 "Neither" ///
                              4 "Approve" 5 "Strongly Approve")) ///
             ylab(`myla') name(predicted,replace) legend(rows(1) pos(12))

graph export "${MyProject}/AfghanResultsH1Predicted.png", replace

gr combine  coefficients predicted, rows(2) ysize(10) 
gr export   "${MyProject}/AfghanResultsCoefficientsPredicted.png", replace
gr export   "${MyProject}/AfghanResultsCoefficientsPredicted.pdf", replace

 ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical'
margins      afghanrussiadeter, atmeans contrast(effects nowald)


* * * * * * * * * * Bar Chart Version
quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical'
margins, atmeans at(afghanrussiadeter==0) post
eststo deter0

quietly ologit 	afghansupportDV i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical'
margins, atmeans at(afghanrussiadeter==1) post
eststo deter1


coefplot deter0 deter1, ///
title({bf: B: Predicted Support for U.S. Response}, size(large) span) ///
             subtitle({it:By Anticipated Russian Reaction; Other Variables at Means}, span size(small)) ///
	recast(bar) barw(0.15) ///
	ciopts(recast(rcap) color(gs8)) citop ///
	 ylab(1 "Strongly Oppose" 2 "Oppose" 3 "Neither" 4"Support" ///
					5 "Strongly Support") ///
	legend(order(1 "Provoke" 3 "Deter") ring(0) pos(2)) ///
	xtitle("Predicted Probability of Choosing Each Response") ///
	name(afghandeterbar, replace) xlab(`myla') 
 


gr combine  coefficients afghandeterbar, rows(2) ysize(10)
gr export   "${MyProject}/AfghanResultsCoefficientsPredictedBar.png", replace
gr export   "${MyProject}/AfghanResultsCoefficientsPredictedBar.pdf", replace
gr export   "${MyProject}/AfghanResultsCoefficientsPredictedBar.eps", replace

* Horizontal Plot


coefplot  (h1m1, label(Base, No Controls) offset(.3)) ///
          (h1m2, label(Base With Controls) offset(.2)) ///
          (h1m3, label(Internet Knowledge) offset(.1)) ///
          (h1m4, label(Internationalism)) ///
          (h1m5, label(Internet Threat) offset(-0.1)) ///
          (h1m6, label(Political Knowledge) offset(-0.2)) ///
		  (h1m7, label(Attentive Only) offset(-0.3)) , drop(_cons) ///
          keep(*.afghantalibantreatment *.afghanrussiadeter) ///
          noomitted nobase xline(0) ///
          title({bf: A: Afghan Attack Results}, size(large) span) ///
          subtitle({it:Ordinal Logistic Coefficients Shown}, ///
            size(small) span) ///
          caption("N of 1187 for all models except for Knowledge, which has 1186." ///
            , size(vsmall)) ///
          headings(1.afghantalibantreatment = "{bf:Russia Attribution}" ///
            1.afghanrussiadeter = "{bf:Russian Reaction}") ///
            name(coefficients,replace) legend(rows(7) ring(0) pos(7))


gr combine  coefficients afghandeterbar, rows(1)
gr export   "${MyProject}/AfghanResultsCoefficientsPredictedBarH.pdf", replace
gr export   "${MyProject}/AfghanResultsCoefficientsPredictedBarH.eps", replace


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*					Analysis of Afghan Do Nothing DV						  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* Base model
quietly reg 	afghandonothing i.afghantalibantreatment i.afghanrussiadeter
eststo 	h1altm1

* Base with controls
quietly reg 	afghandonothing i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical'
eststo 	h1altm2

* Base, controls, and Internet familiarity
quietly reg 	afghandonothing i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' `internetfamiliarity'
eststo 	h1altm3

* Base, controls, and militant
quietly reg 	afghandonothing i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' ///
				 militantinternationalism cooperativeinternationalism
eststo 	h1altm4


* Base, controls, and cyberthreat
quietly reg 	afghandonothing i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' ///
				 `cyberthreat'
eststo 	h1altm5


* Base, controls, and knowledge
quietly reg 	afghandonothing i.afghantalibantreatment i.afghanrussiadeter ///
				`demographics' `technical' ///
				 knowledgeindex
eststo 	h1altm6


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*					Presentation of Results
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


esttab 	h1altm1 h1altm2 h1altm3 h1altm4 h1altm5 h1altm6, ///
				lab noomitted nobase varwidth(25) nodepvars compress ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
				title("Afghan Experiment, DV is ``Do Nothing'', OLS")


esttab 	h1altm1 h1altm2 h1altm3 h1altm4 h1altm5 h1altm6 using "${MyProject}/AfghanTableH1Alt.tex", ///
				lab noomitted nobase varwidth(25) nodepvars compress replace ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
				title("Afghan Experiment, DV is ``Do Nothing'', OLS" \label{tab:afghanh1alt}) ///
        eqlabel(none) longtable notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                , nolabel)


esttab 	h1altm1 h1altm2 h1altm3 h1altm4 h1altm5 h1altm6 using "${MyProject}/AfghanTableH1Alt.rtf", ///
      	lab noomitted nobase varwidth(25) nodepvars compress replace ///
        mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
        title("Afghan Experiment Testing Hypotheses 1 and 2, Alternate DV") ///
        eqlabel(none) notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                , nolabel)

********************************************************************************
*                      	 Interaction Analysis        	                       *
********************************************************************************

* Here we analyze H3 simultaneously:

	* H3: As the cost of providing assistance to a U.S. ally against Russia
	* rises, respondents will support such assistance only if Russia is involved
	* directly.

*	Key treatment variable 1: Russian involvement
*	Key treatment variable 2: Russian response
*	Key variable 3:			  Interaction term

*	Key DV: Overall approval
* 	Check DV: "Do nothing" strategy

*	Statistical method:		For Overall, Ologit unless Brant says mlogit
* 							Do nothing: OLS

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*			         Analysis of Afghan Support DV							  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* Base model
quietly ologit 	afghansupportDV i.afghantalibantreatment##i.afghanrussiadeter
eststo 	h3m1

* Base with controls
quietly ologit 	afghansupportDV i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical'
eststo 	h3m2

* Base, controls, and Internet familiarity
quietly ologit 	afghansupportDV i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical' `internetfamiliarity'
eststo 	h3m3

* Base, controls, and militant
quietly ologit 	afghansupportDV i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical' ///
				 militantinternationalism cooperativeinternationalism
eststo 	h3m4


* Base, controls, and cyberthreat
quietly ologit 	afghansupportDV i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical' ///
				 `cyberthreat'
eststo 	h3m5


* Base, controls, and knowledge
quietly ologit 	afghansupportDV i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical' ///
				 knowledgeindex
eststo 	h3m6


esttab 	h3m1 h3m2 h3m3 h3m4 h3m5 h3m6, ///
				lab noomitted nobase varwidth(25) nodepvars compress ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge")

esttab 	h3m1 h3m2 h3m3 h3m4 h3m5 h3m6 using "${MyProject}/AfghanTableH3.tex", ///
				lab noomitted nobase varwidth(25) nodepvars compress replace ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
        title("Afghan Experiment, Ordinal Logit, DV is Support for ally" \label{tab:afghanh3}) ///
        eqlabel(none) longtable notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                , nolabel)


esttab 	h3m1 h3m2 h3m3 h3m4 h3m5 h3m6 using "${MyProject}/AfghanTableH3.rtf", ///
      	lab noomitted nobase varwidth(25) nodepvars compress replace ///
        mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
        title("Afghan Experiment Testing Hypothesis 3, Main DV") ///
        eqlabel(none) notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                , nolabel)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*					Analysis of Afghan Do Nothing DV						  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* Base model
quietly reg 	afghandonothing i.afghantalibantreatment##i.afghanrussiadeter
eststo 	h3altm1

* Base with controls
quietly reg 	afghandonothing i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical'
eststo 	h3altm2

* Base, controls, and Internet familiarity
quietly reg 	afghandonothing i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical' `internetfamiliarity'
eststo 	h3altm3

* Base, controls, and militant
quietly reg 	afghandonothing i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical' ///
				 militantinternationalism cooperativeinternationalism
eststo 	h3altm4


* Base, controls, and cyberthreat
quietly reg 	afghandonothing i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical' ///
				 `cyberthreat'
eststo 	h3altm5


* Base, controls, and knowledge
quietly reg 	afghandonothing i.afghantalibantreatment##i.afghanrussiadeter ///
				`demographics' `technical' ///
				 knowledgeindex
eststo 	h3altm6



esttab 	h3altm1 h3altm2 h3altm3 h3altm4 h3altm5 h3altm6, ///
				lab noomitted nobase varwidth(25) nodepvars compress ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge")


esttab 	h3altm1 h3altm2 h3altm3 h3altm4 h3altm5 h3altm6 using "${MyProject}/AfghanTableH3Alt.tex", ///
				lab noomitted nobase varwidth(25) nodepvars compress replace ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
          title("Afghan Experiment, DV is ``do Nothing'', OLS" \label{tab:afghanh3alt}) ///
        eqlabel(none) longtable notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                , nolabel)


esttab 	h3altm1 h3altm2 h3altm3 h3altm4 h3altm5 h3altm6 using "${MyProject}/AfghanTableH3Alt.rtf", ///
      	lab noomitted nobase varwidth(25) nodepvars compress replace ///
        mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
        title("Afghan Experiment Testing Hypothesis 3, Alternate DV") ///
        eqlabel(none) notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                , nolabel)


********************************************************************************
*                      			 Subsidiary Analysis       	                       *
********************************************************************************

* Here, we present analyses of each specific strategy, but because they are all
* null we present them as tables only.

* First, we have to recast the data so that it is in long format and then
* work to get all the variables pretty

rename afghantreaty afghanstrategytreaty
rename afghandonothing afghanstrategydonothing
rename afghanindict afghanstrategyindict
rename afghansanctions afghanstrategysanctions
rename afghanairstrikes afghanstrategyairstrikes
rename afghancyber afghanstrategycyber

reshape long afghanstrategy, j(strategy) i(responseid) string
replace strategy = "Do nothing" if strategy == "donothing"
replace strategy = proper(strategy)

lab def strategylab 0 "Do Nothing" 1 "Treaty" 2 "Sanctions" 3 "Indict" ///
                    4 "Cyberattack" 5 "Airstrikes"
encode strategy, gen(strategycode) lab(strategylab)
lab var strategycode "Strategy Type"

gen directstrategy = 0
replace directstrategy = 1 if strategycode == 4 | strategycode == 5
lab var directstrategy "Coercive Strategy"
lab def directstrategylab 0 "Not coercive" 1 "Coercive"
lab val directstrategy directstrategylab


quietly eststo h4m1: reg afghanstrategy i.afghantalibantreatment i.afghanrussiadeter ///
                  i.strategycode  ///
                  if strategycode != 0

quietly eststo h4m2: reg afghanstrategy i.afghantalibantreatment i.afghanrussiadeter ///
                  i.strategycode  ///
                  `demographics' `technical' if strategycode != 0


quietly eststo h4m3: reg afghanstrategy i.afghantalibantreatment i.afghanrussiadeter ///
                  i.strategycode  ///
                  `demographics' `technical' `internetfamiliarity' if strategycode != 0

quietly eststo h4m4: reg afghanstrategy i.afghantalibantreatment i.afghanrussiadeter ///
                  i.strategycode  ///
                  `demographics' `technical' ///
          				 militantinternationalism cooperativeinternationalism if strategycode != 0

quietly eststo h4m5: reg afghanstrategy i.afghantalibantreatment i.afghanrussiadeter ///
                 i.strategycode  ///
                 `demographics' `technical'  `cyberthreat' if strategycode != 0


quietly eststo h4m6: reg afghanstrategy i.afghantalibantreatment i.afghanrussiadeter ///
                i.strategycode  ///
                `demographics' `technical' knowledgeindex if strategycode != 0



esttab 	h4m1 h4m2 h4m3 h4m4 h4m5 h4m6 using "${MyProject}/AfghanTableh4.tex", ///
				lab noomitted nobase varwidth(25) nodepvars compress replace ///
				mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
        title("Afghan Experiment, Specific Strategies, OLS" \label{tab:afghanh4}) ///
        eqlabel(none) longtable notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                2.strategycode "Strategy Types" ///
                , nolabel)


esttab 	h4m1 h4m2 h4m3 h4m4 h4m5 h4m6 using "${MyProject}/AfghanTableh4.rtf", ///
      	lab noomitted nobase varwidth(25) nodepvars compress replace ///
        mtitles("Base" "Controls" "Internet" "MI/CI" "Threat" "Knowledge") ///
        title("Afghan Experiment Testing Hypothesis 4, Specific Strategies") ///
        eqlabel(none) notes ///
        refcat( 1.internethours2 "Daily Internet Use (Hours)" ///
                1.afghantalibantreatment "Russia Attribution" ///
                1.afghanrussiadeter "Russian Reaction" ///
                age "Demographics" ///
                2.strategycode "Strategy Types" ///
                , nolabel)
